package ahblue.cn.tanzi.model.user;

import android.content.Context;
import android.widget.Toast;

import java.util.List;

import ahblue.cn.tanzi.data.source.ApiCallback;
import ahblue.cn.tanzi.data.source.RemoteRepository;

/**
 * Created by fengdongfei on 2018/12/15.
 */

public class TieziModel {

    public static void getTieZi(final Context context , String token, final DataVertifyListener loginListener){
        RemoteRepository repo = RemoteRepository.getsInstance();
        repo.getTiezi(token, new ApiCallback<List<TieziModel>>(){
            @Override
            public void onSuccess(List<TieziModel> data) {
                if (null!=loginListener){
                    loginListener.conver(data);
                }
            }

            @Override
            public void onFailed(String errorMsg) {
                Toast.makeText(context,errorMsg,Toast.LENGTH_LONG).show();
                if (null!=loginListener){
                    loginListener.conver(null);
                }
            }
        });
    }

    public interface DataVertifyListener {
        void conver(List<TieziModel> data);
    }


}
